home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Mathematics / Notebooks / SigProc2.0 / Packages / SignalProcessing / Digital / DSupport.m < prev    next >
Encoding:
Text File  |  1992-08-18  |  3.2 KB  |  131 lines

  1. (*  :Title:    Expression Manipulation Routines for DFT/DTFT Forms  *)
  2.  
  3. (*  :Authors:    Wally McClure, Brian Evans, James McClellan  *)
  4.  
  5. (*
  6.     :Summary:    When loaded into Mathematica, this file will allow 
  7.         for certain transformations from one form to another.
  8.  *)
  9.  
  10. (*  :Context:    SignalProcessing`Digital`DSupport`  *)
  11.  
  12. (*  :PackageVersion:  2.7    *)
  13.  
  14. (*
  15.     :Copyright:    Copyright 1989-1991 by Brian L. Evans
  16.         Georgia Tech Research Corporation
  17.  
  18.     Permission to use, copy, modify, and distribute this software
  19.     and its documentation for any purpose and without fee is
  20.     hereby granted, provided that the above copyright notice
  21.     appear in all copies and that both that copyright notice and
  22.     this permission notice appear in supporting documentation,
  23.     and that the name of the Georgia Tech Research Corporation,
  24.     Georgia Tech, or Georgia Institute of Technology not be used
  25.     in advertising or publicity pertaining to distribution of the
  26.     software without specific, written prior permission.  Georgia
  27.     Tech makes no representations about the suitability of this
  28.     software for any purpose.  It is provided "as is" without
  29.     express or implied warranty.
  30.  *)
  31.  
  32. (*
  33.      :History:    Date Begun -- November 11, 1989
  34.         Made into package --  March 22, 1990
  35.         Support for analog and digital FT's --  September, 1990
  36.         Simplified number of rewrite rules --  February, 1991
  37.  *)
  38.  
  39. (*  :Keywords:    trigonometry, simplification rules    *)
  40.  
  41. (*  :Source:    *)
  42.  
  43. (*  :Warning:    *)
  44.  
  45. (*  :Mathematica Version:  1.2 or 2.0  *)
  46.  
  47. (*  :Limitation:  *)
  48.  
  49. (*
  50.     :Discussion:  These are extended simplification rules
  51.  *)
  52.  
  53. (*  :Functions:      TrigSimplify        *)
  54.  
  55.  
  56.  
  57. (*  B E G I N     P A C K A G E  *)
  58.  
  59. BeginPackage[ "SignalProcessing`Digital`DSupport`",
  60.           "SignalProcessing`Support`SigProc`",
  61.           "SignalProcessing`Support`SupCode`" ]
  62.  
  63.  
  64. If [ TrueQ[ $VersionNumber >= 2.0 ],
  65.      Off[ General::spell ];
  66.      Off[ General::spell1 ] ];
  67.  
  68.  
  69. (*  U S A G E     I N F O R M A T I O N  *)
  70.  
  71. FourierSimplify::usage =
  72.     "FourierSimplify[x] applies exponential to trigonometric rewrite \
  73.     rules to expression x."
  74.  
  75. FVariables::usage =
  76.     "FVariables is a data tag for the transform variables in a \
  77.     Fourier transform."
  78.  
  79. (*  E N D     U S A G E     I N F O R M A T I O N  *)
  80.  
  81.  
  82. Begin[ "`Private`" ]
  83.  
  84.  
  85. (*  FourierSimplify  *)
  86.  
  87. fourierSimplifyRules = {
  88.     a_. Exp[ Complex[0, b_] w_. ] + a_. Exp[ Complex[0, c_] w_. ] :>
  89.     2 a Cos[b w] /;
  90.     ( b == -c ),
  91.  
  92.     a_. Exp[ Complex[0, b_] w_. ] + d_. Exp[ Complex[0, c_] w_. ] :>
  93.     2 I a Sin[b w] /;
  94.     ( b == -c ) && ( (a == -d) || (Simplify[a] == Simplify[-d]) ),
  95.  
  96.     d_ - d_. Exp[ Complex[0, b_] c_. ] :>
  97.     -2 I d Exp[ I b c / 2 ] Sin[ b c / 2 ],
  98.  
  99.     d_. Exp[ Complex[0, b_] c_. ] - d_ :>
  100.     2 I d Exp[ I b c / 2 ] Sin[ b c / 2 ]
  101. }
  102.  
  103. FourierSimplify[ func_ ] :=
  104.     Block [    {newfunc},
  105.         newfunc = func /. fourierSimplifyRules;
  106.         If [ ! SameQ[newfunc, func],
  107.              newfunc = SPSimplify[ newfunc ] ];
  108.         newfunc ]
  109.  
  110.  
  111. (*  E N D     P A C K A G E   *)
  112.  
  113. End[]
  114. EndPackage[]
  115.  
  116. If [ TrueQ[ $VersionNumber >= 2.0 ],
  117.      On[ General::spell ];
  118.      On[ General::spell1 ] ];
  119.  
  120.  
  121. (*  H E L P     I N F O R M A T I O N  *)
  122.  
  123. Combine[ SPfunctions, { FourierSimplify } ]
  124. Protect[ FourierSimplify ]
  125.  
  126.  
  127. (*  E N D I N G     M E S S A G E  *)
  128.  
  129. Print["The supporting functions are loaded for symbolic Fourier transforms."]
  130. Null
  131.